#ifndef _OCCULT_OCCULT_H
#define _OCCULT_OCCULT_H

#include <stdint.h>
#include <amanita/aVector.h>

/** OCCULT_SYSTEMS */
enum {
	OCCULT_SYMBOL,
	OCCULT_ASTROLOGY,
	OCCULT_QABALAH,
	OCCULT_TAROT,
	OCCULT_ENOCH,
	OCCULT_ALCHEMY,
OCCULT_NUM_SYSTEMS
};

/** OCCULT_SYMBOLS */
enum {
	SYMBOL_SPIRIT,							// 'U'
	SYMBOL_FIRE,							// 'J'
	SYMBOL_AIR,								// 'A'
	SYMBOL_WATER,							// 'M'
	SYMBOL_EARTH,							// 'O'
	SYMBOL_ARIES,							// 'H'
	SYMBOL_TAURUS,							// 'V'
	SYMBOL_GEMINI,							// 'Z'
	SYMBOL_CANCER,							// 'C'
	SYMBOL_LEO,								// 'T'
	SYMBOL_VIRGO,							// 'I'
	SYMBOL_LIBRA,							// 'L'
	SYMBOL_SCORPIO,						// 'N'
	SYMBOL_SAGITTARIUS,					// 'S'
	SYMBOL_CAPRICORN,						// 'E'
	SYMBOL_AQUARIUS,						// 'X'
	SYMBOL_PISCES,							// 'Q'
	SYMBOL_SUN,								// 'R'
	SYMBOL_MOON,							// 'G'
	SYMBOL_MERCURY,						// 'B'
	SYMBOL_VENUS,							// 'D'
	SYMBOL_MARS,							// 'P'
	SYMBOL_JUPITER,						// 'K'
	SYMBOL_SATURN,							// 'F'
	SYMBOL_URANUS,							// 'Y'
	SYMBOL_NEPTUNE,						// 'W'
	SYMBOL_PLUTO,							// '+'
SYMBOL_NUM_SYMBOLS
};

/** ALCHEMY_ELEMENTS */
enum {
	ALCHEMY_AIR,
	ALCHEMY_FIRE,
	ALCHEMY_EARTH,
	ALCHEMY_WATER,
	ALCHEMY_SPIRIT,
ALCHEMY_NUM_ELEMENTS
};


typedef uint64_t symbol_t;

struct Symbol {
	symbol_t symbol;
	int system;
	int n;
	int concept;
	int c1;
	int c2;
	int c3;
	int c4;
};


class Occult {
private:
	static const int char2symbol[256];
	static const char symbol2char[256];
	static const int symbol2element[256];
	static const char elemConv[256];

	aVector **txt;

	int elementConv(int elem,int sys);

public:
	Occult();
	~Occult();

	void load();

	const char *month(int m);
	const char *system(int sys);
	const char *symbol(int s);

	const char *elementName(int e,int sys=OCCULT_SYMBOL);
	const char *qualityName(int q);
	const char *energyName(int e);
	const char *zodiacName(int z);
	const char *planetName(int p);
	const char *houseName(int h);
	const char *houseNameShort(int h);
	const char *aspectName(int a);
	const char *aspectPatternName(int p);
	const char *shapingName(int s);
	const char *factorName(int f);
	const char *houseSystemName(int h);
	const char *astroLabel(int l);
	const char *conceptName(int c);
	const char *conceptNamePlur(int c);
	const char *conceptNameDefPlur(int c);

	const char *hebrewLetterName(int h);

	const char *arcanaName(int a);
	const char *minorArcanaName(int m);

	symbol_t singleCode(int s,int c,symbol_t c1);
	symbol_t doubleCode(int s,int c,symbol_t c1,symbol_t c2);
	symbol_t tripleCode(int s,int c,symbol_t c1,symbol_t c2,symbol_t c3);
	symbol_t quadCode(int s,int c,symbol_t c1,symbol_t c2,symbol_t c3,symbol_t c4);
	void parseCode(symbol_t c,Symbol &r);

	int elementConvert(int elem,int sys_fr,int sys_to=OCCULT_SYMBOL);
	int elementToSymbol(int elem,int sys);
	char elementChar(int elem,int sys);

	int charToSymbol(int s) { return char2symbol[s]; }
	char symbolToChar(int s) { return symbol2char[s]; }
	int symbolElement(int s) { return symbol2element[s]; }
};



#endif /* _OCCULT_OCCULT_H */


